package com.chlitina.store.common.listener;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import com.chlitina.store.common.session.BoTongSessionContext;

public class LoginSessionListener implements HttpSessionListener {
	//创建了一个对象来保存session的  
	public static Map<String, HttpSession> userMap = new HashMap<String, HttpSession>(); 
	//MySessionContext是实现session的读取和删除增加  单例模式  
    private   BoTongSessionContext btsc = BoTongSessionContext.getInstance();  
	@Override
	public void sessionCreated(HttpSessionEvent se) {
		btsc.AddSession(se.getSession());
	}

	@Override
	public void sessionDestroyed(HttpSessionEvent se) {
		btsc.DelSession(se.getSession()); 
	}

}
